{%include file="header.html"%}
<script type="text/javascript" src="{%$URL%}resource/laydate/laydate.js"></script>
<style>
table{text-align: center;}
th{text-align:center; font-weight: bolder;}
th a{ color:#000000;}
.firtd {	width: 100px;	padding-right: 10px;	text-align: right;}
input{width: 90px;}
textarea {	width: 350px;	height: 100px;}
#jin{
color:#f00;
}
#jin1{
color:#0D93BF;
}
</style>
<body>
<div class="fixed-bar">
  <div class="item-title">
    <h3>配送员列表</h3>
     <form action="peisong.php" name="searchForm" method="get">
        <input type="hidden" name="act" value="list">
        <!-- 品牌 -->
        <select name="qy" onChange="quyush(this,'pei')" required>
          <option value="0">==请选择==</option>
          {%foreach from=$row item=list%}
            <option value="{%$list.r_id%}" {%if $smarty.get.qy==$list.r_id%}selected="selected"{%/if%}>{%$list.r_name%}</option>
          {%/foreach%}
        </select>
        <select name="pei" >
          <option value="0">==请选择==</option>
          {%foreach from=$p_list item=listp%}
            <option value="{%$listp.s_id%}" {%if $smarty.get.pei==$listp.s_id%}selected="selected"{%/if%}>{%$listp.shop_name%}</option>
          {%/foreach%}
        </select>
        
        <!--关键字-->
        <input type="text"  style="width:180px; height:18px;margin-left:5px; vertical-align: middle;" name="keywords" value="{%$smarty.get.keywords%}" placeholder="关键字">
        <input value="搜索" id="sousuo" style="width:50px; height:27px; margin-top:13px;" class="button" type="submit">
        <div style="background:rgba(251,112,45,1);width:125px;height:40px;float:right;text-align:center;border-radius:5px;">
          <a href="peisong.php?act=edit">
            <h5 style="padding:10px;color:#fff;">添加配送员</h5>
          </a>
        </div>
    </form>
  </div> 
</div>
<div class="fixed_bottom">
  <form method="post" action="" id="aspnetForm" name="form1">
    <table align="center;" class="table tb-type2">
      <thead>
        <tr>
          <th width="50"><a>编号</a></th>
          <th width="25%"><a>配送员名称</a></th>
          <th><a>电话</a></th>
          <th><a>邮箱</a></th>
          <th><a>商户名称</a></th>
          <th><a>操作</a></th>
        </tr>
      </thead>
      <tbody id="sortable">
        {%foreach from=$res item=list key=k%}
            <tr>
              <td>{%$list.user_id%}</td>
              <td>{%$list.user_name%}</td>
              <td>{%$list.mobile_phone%}</td>
              <td>{%$list.email%}</td>
              <td>{%$list.shop_name%}</td>
              <td>
                <a href="peisong.php?act=edit&user_id={%$list.user_id%}">编辑</a> 
                <a href="peisong.php?act=del&user_id={%$list.user_id%}">删除</a> 
              </td>
            </tr>
        {%/foreach%}
      </tbody>
    </table>
   <div class="page"></div>
  </form>
</div>
</body>
<script>
  function quyush(th,cla){
    var id=$(th).val();
    $.post("peisong.php?act=peaj",{id:id},function(data){
      if(data){
        $("select[name="+cla+"]").html(data);
      }else{
        $("select[name="+cla+"]").html("<option value='0'>暂无</option>");
      }
      
    })
  }
</script>
</html>